package com.kg.elysia.service;

import com.kg.elysia.db.DatabaseVerticle;
import com.kg.elysia.db.Mural;
import io.vertx.core.Future;
import io.vertx.core.json.JsonArray;

import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author zj
 * @since 2025/10/20 14:47
 */
public class MuralService {

    private final DatabaseVerticle dbVerticle;

    public MuralService(DatabaseVerticle dbVerticle) {
        this.dbVerticle = dbVerticle;
    }

    public Future<JsonArray> getAllMurals() {
        return Future.future(dbVerticle::getAllMurals);
    }

    public Future<Void> addMural(Mural mural) {
        return Future.future(promise -> dbVerticle.addMural(mural, promise));
    }

    public Future<Integer> batchAddMurals(List<Mural> muralList) {
        return Future.future(promise -> dbVerticle.batchAddMurals(muralList, promise));
    }

    public Future<Void> truncateMurals() {
        return Future.future(dbVerticle::truncateTable);
    }

}
